﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using planetExpressLib;

namespace planet_express
{
    public partial class busq_planetas : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadioButtonList1.AutoPostBack = true;
        }

        protected void visible_buscador(object sender, EventArgs e)
        {
            int num = RadioButtonList1.SelectedIndex;

            listado_planetas.ActiveViewIndex = 1;

            if (num == 0)
            {
                TextBox1.Text = "Buscar...";
                Buscadores.ActiveViewIndex = 0;
            }
            else
                Buscadores.ActiveViewIndex = 1;
            
        }


        protected void lista_planets(object sender, EventArgs e) {


            planetaEN dataPla = new planetaEN();

            GridView1.DataSource = dataPla.gridviewPlaListaEN(DropDownList1.SelectedValue.ToString());
            GridView1.DataBind();

            listado_planetas.ActiveViewIndex = 0;
            
        }

        protected void cadena_planets(object sender, EventArgs e) {


            planetaEN dataPla = new planetaEN();

            string str = TextBox1.Text.ToString(); ;

            GridView1.DataSource = dataPla.gridviewPlaCadenaEN(str);
            GridView1.DataBind();
            

            listado_planetas.ActiveViewIndex = 0;
        }

    }
}